import type { App } from 'vue'
import FileUpload from './FileUpload/index.vue'
import FileSelector from './FileSelector/index.vue'
import FileManager from './FileManager/index.vue'

// 组件列表
const components = [
  FileUpload,
  FileSelector,
  FileManager
]

// 全局注册组件
export function registerGlobalComponents(app: App) {
  components.forEach(component => {
    app.component(component.name || component.__name, component)
  })
}

// 导出组件
export {
  FileUpload,
  FileSelector,
  FileManager
}

export default {
  install(app: App) {
    registerGlobalComponents(app)
  }
}
